package com.hello.sky.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hello.sky.model.entity.User;
import com.hello.sky.model.vo.UserReportVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * 用户信息 Mapper 接口
 * </p>
 *
 * @author D
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {

    User selectByOpenId(@Param("openId") String openId);

    User getById(@Param("userId") Long userId);

    UserReportVO userStatistics(@Param("open") LocalDateTime open, @Param("end") LocalDateTime end);

    Integer countByEnd(@Param("date") LocalDateTime date);

    Integer countBySingleDate(@Param("begin") LocalDate begin, @Param("end") LocalDate end);
}
